// UC 14.01
// Joeri De Smet c1022784

package controllers;

import java.io.FileNotFoundException;

import javax.swing.JFrame;

import controllers.uiControllers.MainViewController;
import controllers.uiControllers.PortalController;
import views.BoardingCheckView;
import core.logic.services.BoardingCheckService;
import core.models.dataModels.BoardingCheckModel;

public class BoardingCheckController {
private static JFrame scherm;
	
	public static void showView(){
		
						
		
	scherm = new BoardingCheckView();
	MainViewController.showView(scherm);
	}
	
	public static void closeView()
	{
		MainViewController.removeView(scherm);
		scherm.dispose();
		PortalController.showView();
	}
	
	
	public static BoardingCheckModel PassagierGegevensUpdate(BoardingCheckModel _model,String XmlLocatie) throws FileNotFoundException
	{
		
		
			try
			{
				_model.setPassagiergegevens(BoardingCheckService.getPassagiergegevensFromXML(XmlLocatie));
			}
			catch (FileNotFoundException fnfe)
			{
				throw fnfe;
			}
			
		
		return _model;
		
	}
	
	public static BoardingCheckModel PassagiersLijstUpdate(BoardingCheckModel _model,int VluchtID)
	{
		
		_model.setPassagierlijst(BoardingCheckService.getPassagiersByVluchtID(VluchtID));
		return _model;
	}

}
